<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="top.jsp" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet"  href="static/css/bootstrap.min.css" />
<script type="text/javascript" src="static/js/jquery.js"></script>
	<style type="text/css">
			body{
				padding-top:50px;
			
			}
	
	</style>
</head>
<body class="body">
	<div class="container">
	  <div class="row">
	  
	   <!-- 导入左侧部分 -->
		<jsp:include page="side.jsp">
			<jsp:param value="contact" name="tag"/>
		</jsp:include>
		
		<div class="span9">
			<form class="form-horizontal"  id="myform" action="contact.jspx?m=save" method="post">
        <fieldset>
          <legend>添加新联系人</legend>
          <div class="control-group">
            <label class="control-label" for="input01" >姓名</label>
            <div class="controls">
              <input type="text" class="span5" id="name" name="name"  style="height:30px" ><br/><span id="name-erro" style="color:red"></span>
            </div>
          </div>
		   <div class="control-group">
            <label class="control-label" for="input01">公司</label>
            <div class="controls">
              <input type="text" class="span5" id="input01" name="company"   style="height:30px">
            </div>
          </div>
		  <div class="line"></div>
		   <div class="control-group">
            <label class="control-label" for="input01" >手机</label>
            <div class="controls">
              <input type="text" class="span5" id="input01" name="cellphone"  style="height:30px">
            </div>
          </div>
		   <div class="control-group">
            <label class="control-label" for="input01" >固话</label>
            <div class="controls">
              <input type="text" class="span5" id="phone" name="phone"  style="height:30px"><br/><span id="phone-erro"  style="color:red"></span>
            </div>
          </div>
		  <div class="control-group">
            <label class="control-label" for="input01">邮箱</label>
            <div class="controls">
              <input type="text" class="span5" id="email" name="email"   style="height:30px"><br/><span id="email-erro"  style="color:red"></span>
            </div>
          </div>
		   <div class="line"></div>
		  <div class="control-group">
            <label class="control-label" for="input01">地址</label>
            <div class="controls">
              <input type="text" class="span5" id="input01" name="address"  style="height:30px">
            </div>
          </div>
		   <div class="line"></div>
		   <div class="control-group">
            <label class="control-label" for="input01">主页</label>
            <div class="controls">
              <input type="text" class="span5" id="input01" value="" name="website"  style="height:30px">
            </div>
          </div>
		   <div class="control-group">
            <label class="control-label" for="input01">微博</label>
            <div class="controls">
				<select class="span2" name="weibo">
					<option></option>
					<option>新浪微博</option>
					<option>腾讯微博</option>
					<option>Twitter</option>
				</select>
				<div class="input-prepend">
					<span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text"   style="height:30px">
                </div>
				
            </div>
          </div>
		   <div class="control-group">
            <label class="control-label" for="input01">简介</label>
            <div class="controls">
              <textarea class="span5"  rows="6"  name="introduction" ></textarea>
            </div>
          </div>
		  
          <div class="form-actions">
            <button type="button" id="btn2" class="btn btn-primary">保存</button>
            <button class="btn" onclick="location.back()">返回</button>
          </div>
        </fieldset>
      </form>          
          	
		</div>
		<div class="span3">
			
		</div>
	  </div>
	</div>
	<script type="text/javascript" >
	$(document).ready(function(){
	  	$("#name").keydown(function(){
			$("#name-erro").html("");
			$("#phone-erro").html("");
			$("#email-erro").html("");
		});
		$("#btn2").click(function(){
			var name=$("#name").val();
			if(name.trim()==""){
				$("#name").focus();
				$("#name-erro").html("请输入用户名");
				
			}
			var phone=$("#phone").val();
			var myRegExp=/^(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}$/;
			if(myRegExp.test(phone)){
				return true;
			}else{
				$("#phone").focus();
				$("#phone-erro").html("请输入正确的固话号码，如：0391-3883383");
			}
			var email=$("#email").val();
			var myEmail=/^[\w-_\.]+@([\w-]+\.)+[\w-]+$/;
			if(myEmail.test(email)){
				return true;
			}else{
				$("#email-erro").html("请输入正确的邮箱");
			}
			
			
	});
	
	  
	
	});

	
	
	</script>
	
	
</body>
</html>